package com.itheima.service;

import com.itheima.pojo.Article;
import com.itheima.pojo.PageBean;
import com.itheima.pojo.User;
import jakarta.validation.constraints.Pattern;
import org.hibernate.validator.constraints.URL;

import java.util.List;

public interface Userservice {
    User findByUserName(String username);

    String findEmailByUserName(String username);

    void register(String username, String password,String email,String nickname);

    void update(User user);

    void updateAvatar(@URL String avatarUrl);

    void updatePassword(@Pattern(regexp = "^\\S{5,16}$") String newPwd);

    void forgetPassword(@Pattern(regexp = "^\\S{5,16}$") String newPwd,String username);

    PageBean<User> findAllUser(Integer pageNum, Integer pageSize, String nickname, String email);

    void deleteUser(Integer id);
}
